﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.ComponentModel.DataAnnotations;

namespace Sources
{
    [DataContract]
    public class PiketsJournal
    {
        /// <summary>
        /// Класс Пикетажного журнала 
        /// </summary>
        [DataMember]
        [DisplayAttribute(Name = "Свойства журнала")]
        public PiketProperty PktProperty
        {
            set;
            get;
        }

        [DataMember]
        [DisplayAttribute(Name = "Список пикетов")]
        public List<Piket> Pikets
        {
            set;
            get;
        }
        
        public PiketsJournal()
        {
            Pikets = new List<Piket>();
        }


        #region MyCave() -- Создание тестового журнала
        /// <summary>
        /// Создание тестового журнала
        /// </summary>
        public void MyCave()
        {
            PktProperty = new PiketProperty();
            PktProperty.Name = "MyCave";
            PktProperty.Desc = "Тестовая пикетажка";
            PktProperty.Date = "03.09.2012";
            Pikets = new List<Piket>();
            Pikets.Add(new Piket() { From = "1", To = "2", Length = 1.00, Bearing = 10, Inc = 0 });
            Pikets.Add(new Piket() { From = "Rn1", To = "2", Length = 0.90, Bearing = 200, Inc = 0 });
            Pikets.Add(new Piket() { From = "Rn1", To = "4", Length = 0.75, Bearing = 300, Inc = 0 });
            Pikets.Add(new Piket() { From = "4", To = "5", Length = 1.00, Bearing = 330, Inc = 0 });
            Pikets.Add(new Piket() { From = "Rn1", To = "6", Length = 0.50, Bearing = 80, Inc = 0 });
            Pikets.Add(new Piket() { From = "6", To = "7", Length = 1.50, Bearing = 100, Inc = 0 });
            Pikets.Add(new Piket() { From = "8", To = "6", Length = 0.80, Bearing = 225, Inc = 0 });
        }
        #endregion MyCave()
    }
}
